# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-indicator-display
pkgver=24.4.0
pkgrel=0
pkgdesc="Ayatana Indicator Display"
url="https://github.com/AyatanaIndicators/ayatana-indicator-display"
arch="all"
license="GPL-3.0-only"
makedepends="
	accountsservice-dev
	cmake
	cmake-extras
	geoclue-dev
	glib-dev
	intltool
	libayatana-common-dev
	libgudev-dev
	properties-cpp-dev
	samurai
	"
subpackages="$pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-display/archive/$pkgver/ayatana-indicator-display-$pkgver.tar.gz"
options="!check" # requires unpackaged dependencies (at least libqtdbusmock & libqtdbustest)

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
d0ed75063f34db09a8e5e1b14882b34e97cf30592e8859d43ca75816cba543478872aadc946c19a013b2f4b0533426cfc4d465ac2b98aad18b82b85b5e141d8f  ayatana-indicator-display-24.4.0.tar.gz
"
